package com.sumainfor.pc.market.feign;

import com.sumainfor.common.util.JsonResult;
import com.sumainfor.pc.market.fallback.GetUserInfoFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Collection;

/**
 * @Author PuaChen
 * @Create 2018-11-08 15:36
 */
@FeignClient(name = "TANGNEST-ZUUL", fallback = GetUserInfoFallback.class)
public interface GetUserInfoFeign {


    @GetMapping("/key/getdeptController/getnamebyid")
    String getnamebyid(@RequestParam(value = "id") String id);


    /**
     * 调用Zuul 获取用户的信息 和部门名称
     *
     * @return Map结构数据
     */
    @PostMapping("/provider/getUser")
    JsonResult getUserInfo(@RequestBody Collection<String> ids);

    /**
     * 通过用户的ID 获取用户所在的服务中心编号
     *
     * @param userId
     * @return
     */
    @PostMapping("/provider/getCenterServiceInfo")
    JsonResult getCenterServiceInfo(@RequestParam("userId") String userId);
}
